package io.sdph.view;

import java.util.ArrayList;

/**
 * Klasa dla menu (znajdujacego sie zarowno w stopce jak i naglowku)
 * 
 * @author MODUL FRONTU (www) *
 */
public class MenuPanel {

	ArrayList<String[]> menuList;
	
	/**
	 * Konstruktor dla MenuPanel (tworzy liste zakladek)
	 * Kazda zakladka to para: [0] nazwa dluga (wyswietlana w menu), [1] nazwa krotka - nazwa url, uzywana do dynamicznego ladowania tresci)
	 */
	MenuPanel() {		
		menuList = new ArrayList<String[]>();	
		
		// adding elements to the menu -> [0] full name, [1] short name
		String[] item1 = {"Our offer", "offer"};
		String[] item2 = {"Contact", "contact"};
		menuList.add(item1);
		menuList.add(item2);
	}
	
	/**
	 * Konstruktor dla MenuPanel ktory tworzy menu w zaleznosci od typu strony (admin/page/client)
	 * @param String type (admin/page/client)
	 */
	MenuPanel(String type) {
		menuList = new ArrayList<String[]>();	
		
		// adding elements to the menu -> [0] full name, [1] short name, [2] description
		if (type.equals("admin")) {
			String[] item1 = {"Manage users", "user", "Add, modify or delete user"};
			String[] item2 = {"Manage products", "products", "Add, modify or delete products"};
			String[] item3 = {"Analyse statistics", "stat", "Analyse the statistics from the database"};
			String[] item4 = {"Set credit limit", "creditLimit", "Set credit limit to the client account"};
			String[] item5 = {"Set payment status", "paymentStatus", "Set payment status for the client account"};
			menuList.add(item1);
			menuList.add(item2);
			menuList.add(item3);
			menuList.add(item4);
			menuList.add(item5);
		}
		else if (type.equals("page")) {
			String[] item1 = {"Our offer", "offer"};
			String[] item2 = {"Contact", "contact"};
			menuList.add(item1);
			menuList.add(item2);
		}
		else if (type.equals("client")) {
			String[] item1 = {"Order visit", "orderVisit", "Order sales representative visit"};
			String[] item2 = {"Order products", "orderProducts", "Order products by selected sales representative "};
			String[] item3 = {"Credit info", "creditInfo", "Get informations about your credit balance"};
			menuList.add(item1);
			menuList.add(item2);
			menuList.add(item3);
		}
	}

	/**
	 * Getter dla listy menu
	 * @return ArrayList<String[]> menuList
	 */
	public ArrayList<String[]> getMenuList() {
		return menuList;
	}

	/**
	 * Setter dla listy menu
	 * @param ArrayList<String[] menuList
	 */
	public void setMenuList(ArrayList<String[]> menuList) {
		this.menuList = menuList;
	}
	
	
}
